# Contributor: Francesco Colista <francesco.colista@gmail.com>
# Maintainer: Francesco Colista <francesco.colista@gmail.com>
pkgname=darkice
pkgver=1.4
pkgrel=0
pkgdesc="Live audio streamer. Records audio from an audio interface, encodes it and sends it to a streaming server"
url="http://www.darkice.org/"
arch="all"
license="GPL-3.0-or-later"
makedepends="alsa-lib-dev faac-dev lame-dev libvorbis-dev"
subpackages="$pkgname-doc"
source="https://github.com/rafael2k/darkice/releases/download/v$pkgver/darkice-$pkgver.tar.gz
	darkice.initd
	darkice.confd"

build() {
	CPPFLAGS="$CPPFLAGS -fpermissive" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc/darkice \
		--without-aacplus \
		--without-twolame
	make
}
package() {
	mkdir -p "$pkgdir"/etc/$pkgname
	make DESTDIR="$pkgdir" install
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
}

sha512sums="708ab08a45e216dce350f6cd36374e10d4606f77f0cde4dfbf35675d9d0778fb7a013b49fd62d713039d5fcfb9e7d66e6b7ae14acf1e5f142685eecdf7a865bc  darkice-1.4.tar.gz
743f4e24bf4bfa57a46f643dc000cd40f24e382e50c657bb6bb2a13492e337bbec5b1c03e0824046e30725737bdf81ce838bc61cd4b3b383b013e6bcad9475c6  darkice.initd
9491c3d0ff34750a60cec93eeaa7442714209fdb085e4d4d47a15b991850c861f0003d446d1a3205b452c9badc68b34beafd6c37798a3744098a3665f7f34f34  darkice.confd"
